<template>
    <h3>投资</h3>
    项目名称<input type="text" v-model="Sharinfo.IName">
    总金额<input type="text" v-model="Sharinfo.Minprice">
    -<input type="text" v-model="Sharinfo.Maxprice">
    <input type="button" value="查询" @click="Show">
    <table border="1">
        <tr>
            <td>用户名称</td>
            <td>用户类型</td>
            <td>投资项目</td>
            <td>项目总金额</td>
            <td>操作</td>
        </tr>

        <tr v-for="item in info">
            <td>{{item.IUName}}</td>
            <td>{{item.IUType}}</td>
            <td>{{item.IName}}</td>
            <td>{{item.Sumprice}}</td>
            <a href="#"  @click="UserInvtestInfo">用户投资明细</a>
        </tr>
    </table>


</template>


<script setup lang="ts">
import {ref,onMounted} from 'vue';
import axios from 'axios';


onMounted(()=>{
    Show();
})

const info=ref({
    IUName:"",
    IUType:"",
    IName:"",
    Sumprice:""
})

const Sharinfo=ref({
    IName:"",
    Minprice:"",
    Maxprice:""
})

const Show=()=>{
   axios.get("http://localhost:4611/api/Invest/ShowInvest",{
    params:{
        IName:Sharinfo.value.IName,
        Minprice:Sharinfo.value.Minprice,
        Maxprice:Sharinfo.value.Maxprice
    }
   })
   .then(res=>{
        info.value=res.data
   })
}

const UserInvtestInfo=()=>{
    location.href="/UserInvest"
}

</script>